package com.artpri.action.goods;

import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

import com.artpri.action.BaseAction;
import com.artpri.model.GoodsCategory;

/**
 * 商品分类-广告位数据获取
 * @author ZhangSi
 *
 */
@Namespace("/page/goods")
@ParentPackage("json-default")
public class GoodsCategoryAction extends BaseAction {

	private static final long serialVersionUID = 6221714151677579565L;

	private Integer gcgId;
	
	private List<GoodsCategory> categoryList;
	
	/**
	 * 商品详情页面-相关分类
	 */
	@Action(value="relateCategory", results={
			@Result(name="success", type="json", params={"root", "categoryList"})
	})
	public String relateCategory() throws Exception {
		categoryList = getGoodsCategoryService().getCategoryByGroup(gcgId);
		return SUCCESS;
	}

	

	public List<GoodsCategory> getCategoryList() {
		return categoryList;
	}

	public void setCategoryList(List<GoodsCategory> categoryList) {
		this.categoryList = categoryList;
	}

	public Integer getGcgId() {
		return gcgId;
	}

	public void setGcgId(Integer gcgId) {
		this.gcgId = gcgId;
	}
}
